home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir42 / bltc18z.zip / !README2.TXT < prev    next >
Text File  |  1994-02-04  |  2KB  |  54 lines

  1. Read me too (shareware release)
  2. BULLET v1.08 (BLTC18.ZIP)
  3.  
  4. --Status value return code with transaction-based routines
  5.  
  6. The transaction-based routines, InsertXB, UpdateXB, ReindexXB, LockXB and
  7. UnlockXB, do not return the completion status. The return value is the
  8. pack index number that failed. The following example assumes that you are
  9. using multiple index files. If you're not, replace AP(x).y with AP.y.
  10.  
  11.    AP[0].Func = INSERTXB;
  12.    pid = BULLET(&AP);
  13.    if (pid == 0) {
  14.       if (AP[0].stat == 0) {
  15.          /* all okay */
  16.       else {                  /* error while adding the data record is       */
  17.          rstat = AP[1].stat;  /* returned in AP(1).stat if and only if pid=0 */
  18.          DoErrorWithDataRecord(stat);
  19.          }
  20.       }
  21.    else {
  22.       rstat = AP[pid].stat;
  23.       DoErrorWithIndexFile(pid, stat);
  24.       }
  25.    }
  26.  
  27. For complete information consult the above named routines in CZ. Note that
  28. ReindexXB does not operate on a data file separately so if its return
  29. code=0 (pid=0) then all operations succeeded. However, with the LockXB
  30. routines, if pid > number_of_packs then the lock on the data file failed.
  31. The following example assumes that a single index file and data file are
  32. to be locked.
  33.  
  34.    packs = 1;                 /* 1 pack (single index file per data file) */
  35.    AP.Func = LOCKXB;
  36.    pid = BULLET(&AP);
  37.    if (pid == 0) {
  38.       /* all okay */
  39.    else
  40.       if (pid <= packs) {   /* error while locking index file and error code */
  41.          rstat = AP.stat;           /* in AP.stat */
  42.          DoErrorWithIndexFile(stat);
  43.          }
  44.       else {                /* error while locking data file and error code */
  45.          stat = AP.stat;    /* also in AP.stat */
  46.          DoErrorWithDataFile(stat);
  47.       }
  48.    }
  49.  
  50. --In case a C example does not compile, do not assume that the example is 100%
  51. correct C and that something must be wrong. I'm no C programmer--not by a mile.
  52. If something doesn't compile make the needed corrections. Let me know about my
  53. mistakes and I will be ever so grateful. -chh
  54.